# Definition for a binary tree node.
# class TreeNode(object):
#     def __init__(self, val=0, left=None, right=None):
#         self.val = val
#         self.left = left
#         self.right = right

#%% 前序
class Solution(object):
    def inorderTraversal(self, root):
        """
        :type root: TreeNode
        :rtype: List[int]
        """

        def preorder(root):
            if not root:
                return
            res.append(root.val)
            preorder(root.left)
            preorder(root.right)

        res = list()
        preorder(root)
        return res
#%% 中序
class Solution(object):
    def inorderTraversal(self, root):
        """
        :type root: TreeNode
        :rtype: List[int]
        """

        def preorder(root):
            if not root:
                return
            preorder(root.left)
            res.append(root.val)
            preorder(root.right)

        res = list()
        preorder(root)
        return res
#%% 后序
class Solution(object):
    def inorderTraversal(self, root):
        """
        :type root: TreeNode
        :rtype: List[int]
        """

        def preorder(root):
            if not root:
                return
            preorder(root.left)
            preorder(root.right)
            res.append(root.val)

        res = list()
        preorder(root)
        return res

root = [1,null,2,3]
Solution().inorderTraversal(root)